home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0185.arc
/
MACPRO.LTG
< prev
next >
Wrap
Text File
|
1986-10-01
|
5KB
|
112 lines
MACRO FORMAT
;testmac.asm A format for testing MACROS
;the format uses a COM file type since the byte size of the file
;as displayed by the 'directory' reflects just the assembled code
;must use exe2bin after obtaining the EXE file to get COM file
;
; ENTEZ MACROS in this section
;
service macro fn,in ;call for function # and
mov ah,fn ;interrupt #. Can be used
int in ;for either ROMBIOS or DOS
endm ;End Macro,4 bytes of code when invoked
;
chrtoscr mac chr ;display chr on screen
mol ;DOS use only
se, ;function 2, INT 21h for DOS
e ;End Macro,6 bytes of code when invoked
;
crlf macro ;carriage return,linefeed
chrtoscr 13 ;carriage return
chrtoscr 10 ;line feed
endm ;End macro,12 bytes of code when invoked
;
;Start of actual code section
;
codeseg segment ;start of codeseg,pseudo-op
assume cs:codeseg ;define code segment,pseudo-op
org 100h ;required for COM, pseudo-op
;
begin: ;actual code below,'begin' is label
chrtoscr 49 ;print ASCII 49 on screen(1),6 bytes
crlf ;carriage return,linefeed, 12 bytes
chrtoscr 50 ;print ASCII 50 on screen(2),6 bytes
;
service 4ch,21h ;return to DOS,see E-3 of DOS 2.0 Manual
;4 bytes
codeseg ends ;end of codeseg,pseudo-op
end begin ;where to start,pseudo-op
;
;Fini ;24 bytes of executable code in macros
; 4 bytes of executable code in DOS rtn
;Total Executable Code is 28 bytes as portrayed
------------------------------------------------------------------
PROCEDURE FORMAT
;testproc.asm program to test PROCEDURES
;will use COM format for program so that size displayed by DIR
;command is true size of executable assembled code; again must
;use exe2bin to convert EXE to COM file as in above
;
;Start of actual code section
;
codeseg segment ;start of codeseg,pseudo-op
assume cs:codeseg ;define code segment pseudo-op
org 100h ;required for COM, pseudo-op
;
begin: ;actual excecutable code below
mov dl,49 ;pass ASCII chr (1) for CALL, 2 bytes
call chrtoscr ;call is 3 bytes
call crlf ;call is 3 bytes
mov dl,50 ;pass ASCII(2) for CALL, 2 bytes
call chrtoscr ;call is 3 bytes
;
;total code in this section used is 13 bytes
;
;a good place to put your PROCEDURES that you do not want done in
;line is below the return to DOS code. They will of course be 'near'
;since they are in the same code segment.
;
mov ah,4ch ;ready to return to DOS , see E-3
int 21h ;Manual 2.0, total code here ,4 bytes
;for these two lines
;
;PROCEDURES below not done in line
;
servdos proc ;define PROCEDURE 'servdos' for DOS calls
int 21h ;must pass function before use,2 bytes
ret ;return to calling location,1 byte
servdos endp ;end of procedure,3 bytes to define
;
crlf proc ;carriage return line feed is useful
mov dl,13 ;carriage return,2 bytes
mov ah,2 ;DOS function 2,2 bytes
int 21h ;DOS interrupt,2 bytes
mov dl,10 ;line feed,2 bytes
mov ah,2 ;same as above, 2 bytes
int 21h ;same as above, 2 bytes
ret ;near return,no-pop, 1 byte
crlf endp ;end of procedure,13 bytes to define
;
chrtoscr proc ;define PROC to send chr to screen
mov ah,2 ;function 2, must pass chr in dl,2bytes
int 21h ;DOS function, 2 bytes
ret ;return to call place, 1 byte
chrtoscr endp ;end of procedure, 5 bytes to define
;
;total code assembled here in defining PROCEDURES is 21 bytes
;
codeseg ends ;end of codeseg,pseudo-op
en e to start,pseudo-op;
;
;Fini 21 bytes used for procedure definitions
;13 bytes for calls and passing data
; 4 bytes for return to DOS
;38 bytes Total Assembled code of which 3 is in servdos, not used
;but which appears in total as it is nevertheless assembled
;